﻿import Types from '../actionTypes';

let initState = {
  current: 1,
  pageCount: 1,  // 总数量
  purchaseList: []
};

export default (state = initState, action) => {
  const newState = JSON.parse(JSON.stringify(state));
  console.log(action);
  switch (action.type) {
    case Types.GET_HISTORY_PURCHASE_LIST:
      newState.current = +action.data.pageCurrent;
      newState.purchaseList = action.data.data;
      newState.pageCount = action.data.pageCount;
      return newState;

    default:
      console.log('Types no match in historyPurchase.js ....');
  }
  return state;
}
